/*
 * Player.h
 *
 */

#ifndef PLAYER_H_
#define PLAYER_H_

#include "Model3D.h"
#include "Level.h"
#include "ObjModel.h"
#include "Bomb.h"
#include "Skybox.h"

#define MOVE_SPEED	0.004f
#define ROT_SPEED	0.2f
#define ANIM_SPEED	0.009f
#define PI_OVER_180	0.0174532925f
#define PI 			3.1415926535f
#define HALF_PI		1.5707963267f
#define NUM_BOMBS	10

class Player : public Model3D {
public:
	Player(Level *level, Skybox *skybox, int n);
	virtual ~Player();

	void setCameraMatrix();
	void movePlayer(float x, float y, float z, float milis);
	void rotatePlayer(float x, float z, float milis);
	void initializeGL();
	void renderGL();
	bool setBomb();
	void renderBombs();
	void pickupBonus(int bonus_id);
	bool isBlocked();
	bool isDead();

	int numFlame();
	int numBombs();
	int numLives();

	bool isDrunk();
	void setSober();
	bool isOnSkates();
	void takeAwaySkates();
	float drunk_countdown;
	float skates_countdown;

	bool game_over;

protected:
	void renderPlayer();

	int number;

	bool blocked;
	int lives;
	float timeout;
	float dead_rot;

	Level *level;
	Skybox *skybox;
	float moveSpeed;
	float rotSpeed;

	ObjModel *objBomb[6];
	Bomb *bomb[NUM_BOMBS];

	int bonus_bombs;
	int bonus_flame;
	bool bonus_drunk;
	bool bonus_skates;

	ObjModel *lleg;
	ObjModel *rleg;
	ObjModel *larm;
	ObjModel *rarm;
	ObjModel *body;

	float anim_t;
	float anim_dt;

};

#endif /* PLAYER_H_ */
